home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmFlanger.frm < prev    next >
Text File  |  2001-10-08  |  9KB  |  320 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmFlanger 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Flanger Effects Update"
  6.    ClientHeight    =   4440
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4440
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.OptionButton optTriangle 
  18.       Caption         =   "Triangle"
  19.       Height          =   255
  20.       Left            =   1680
  21.       TabIndex        =   2
  22.       Top             =   3540
  23.       Width           =   915
  24.    End
  25.    Begin VB.OptionButton optSin 
  26.       Caption         =   "Sine"
  27.       Height          =   255
  28.       Left            =   120
  29.       TabIndex        =   1
  30.       Top             =   3540
  31.       Width           =   915
  32.    End
  33.    Begin VB.CommandButton cmdOK 
  34.       Caption         =   "OK"
  35.       Height          =   315
  36.       Left            =   1800
  37.       TabIndex        =   0
  38.       Top             =   3960
  39.       Width           =   915
  40.    End
  41.    Begin MSComctlLib.Slider sldFeedback 
  42.       Height          =   195
  43.       Left            =   60
  44.       TabIndex        =   3
  45.       Top             =   300
  46.       Width           =   2655
  47.       _ExtentX        =   4683
  48.       _ExtentY        =   344
  49.       _Version        =   393216
  50.       LargeChange     =   10
  51.       Min             =   -99
  52.       Max             =   99
  53.       SelStart        =   1
  54.       TickFrequency   =   10
  55.       Value           =   1
  56.    End
  57.    Begin MSComctlLib.Slider sldDelay 
  58.       Height          =   195
  59.       Left            =   60
  60.       TabIndex        =   4
  61.       Top             =   840
  62.       Width           =   2655
  63.       _ExtentX        =   4683
  64.       _ExtentY        =   344
  65.       _Version        =   393216
  66.       LargeChange     =   2
  67.       Max             =   4
  68.    End
  69.    Begin MSComctlLib.Slider sldDepth 
  70.       Height          =   195
  71.       Left            =   60
  72.       TabIndex        =   5
  73.       Top             =   1380
  74.       Width           =   2655
  75.       _ExtentX        =   4683
  76.       _ExtentY        =   344
  77.       _Version        =   393216
  78.       Max             =   100
  79.       TickFrequency   =   10
  80.    End
  81.    Begin MSComctlLib.Slider sldFreq 
  82.       Height          =   195
  83.       Left            =   60
  84.       TabIndex        =   6
  85.       Top             =   1920
  86.       Width           =   2655
  87.       _ExtentX        =   4683
  88.       _ExtentY        =   344
  89.       _Version        =   393216
  90.       TickFrequency   =   2
  91.    End
  92.    Begin MSComctlLib.Slider sldPhase 
  93.       Height          =   195
  94.       Left            =   60
  95.       TabIndex        =   7
  96.       Top             =   2460
  97.       Width           =   2655
  98.       _ExtentX        =   4683
  99.       _ExtentY        =   344
  100.       _Version        =   393216
  101.       LargeChange     =   2
  102.       Max             =   4
  103.    End
  104.    Begin MSComctlLib.Slider sldWetDry 
  105.       Height          =   195
  106.       Left            =   60
  107.       TabIndex        =   8
  108.       Top             =   3000
  109.       Width           =   2655
  110.       _ExtentX        =   4683
  111.       _ExtentY        =   344
  112.       _Version        =   393216
  113.       LargeChange     =   10
  114.       SmallChange     =   5
  115.       Max             =   100
  116.       SelStart        =   1
  117.       TickFrequency   =   10
  118.       Value           =   1
  119.    End
  120.    Begin VB.Label lbl 
  121.       BackStyle       =   0  'Transparent
  122.       Caption         =   "Frequency"
  123.       Height          =   255
  124.       Index           =   4
  125.       Left            =   60
  126.       TabIndex        =   15
  127.       Top             =   1680
  128.       Width           =   1035
  129.    End
  130.    Begin VB.Label lbl 
  131.       BackStyle       =   0  'Transparent
  132.       Caption         =   "Depth"
  133.       Height          =   255
  134.       Index           =   3
  135.       Left            =   60
  136.       TabIndex        =   14
  137.       Top             =   1140
  138.       Width           =   1035
  139.    End
  140.    Begin VB.Label lbl 
  141.       BackStyle       =   0  'Transparent
  142.       Caption         =   "Delay"
  143.       Height          =   255
  144.       Index           =   0
  145.       Left            =   60
  146.       TabIndex        =   13
  147.       Top             =   600
  148.       Width           =   735
  149.    End
  150.    Begin VB.Label lbl 
  151.       BackStyle       =   0  'Transparent
  152.       Caption         =   "Feedback"
  153.       Height          =   255
  154.       Index           =   1
  155.       Left            =   60
  156.       TabIndex        =   12
  157.       Top             =   60
  158.       Width           =   735
  159.    End
  160.    Begin VB.Label lbl 
  161.       BackStyle       =   0  'Transparent
  162.       Caption         =   "Phase"
  163.       Height          =   255
  164.       Index           =   2
  165.       Left            =   60
  166.       TabIndex        =   11
  167.       Top             =   2220
  168.       Width           =   1035
  169.    End
  170.    Begin VB.Label lbl 
  171.       BackStyle       =   0  'Transparent
  172.       Caption         =   "Wave Form"
  173.       Height          =   255
  174.       Index           =   5
  175.       Left            =   60
  176.       TabIndex        =   10
  177.       Top             =   3300
  178.       Width           =   915
  179.    End
  180.    Begin VB.Label lbl 
  181.       BackStyle       =   0  'Transparent
  182.       Caption         =   "Wet Dry Mix"
  183.       Height          =   255
  184.       Index           =   6
  185.       Left            =   60
  186.       TabIndex        =   9
  187.       Top             =   2760
  188.       Width           =   1035
  189.    End
  190. End
  191. Attribute VB_Name = "frmFlanger"
  192. Attribute VB_GlobalNameSpace = False
  193. Attribute VB_Creatable = False
  194. Attribute VB_PredeclaredId = True
  195. Attribute VB_Exposed = False
  196. Option Explicit
  197. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  198. '
  199. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  200. '
  201. '  File:       frmFlanger.frm
  202. '
  203. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  204. Private oBuffer As DirectSoundSecondaryBuffer8
  205. Private mlIndex As Long
  206.  
  207. Private oFX As DirectSoundFXFlanger8
  208.  
  209. Private Sub SaveAllSettings()
  210.     Dim fxNew As DSFXFLANGER
  211.     
  212.     'Ok, save these new settings
  213.     'Set the new information up
  214.     With fxNew
  215.         .fFeedback = CSng(sldFeedback.Value)
  216.         .fDelay = CSng(sldDelay.Value)
  217.         .fDepth = CSng(sldDepth.Value)
  218.         .fWetDryMix = CSng(sldWetDry.Value)
  219.         .fFrequency = CSng(sldFreq.Value)
  220.         .lPhase = sldPhase.Value
  221.         If optSin.Value Then
  222.             .lWaveform = DSFX_WAVE_SIN
  223.         ElseIf optTriangle.Value Then
  224.             .lWaveform = DSFX_WAVE_TRIANGLE
  225.         End If
  226.     End With
  227.     'Now update the effect
  228.     oFX.SetAllParameters fxNew
  229. End Sub
  230.  
  231. Private Sub cmdOK_Click()
  232.     SaveAllSettings
  233.     Unload Me
  234. End Sub
  235.  
  236. Private Sub Form_Load()
  237.     Dim fxCurrent As DSFXFLANGER
  238.     
  239.     'Get the echo interface
  240.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_FLANGER, mlIndex, IID_DirectSoundFXFlanger)
  241.     'Get the current settings from it
  242.     fxCurrent = oFX.GetAllParameters
  243.     'Now put them out there
  244.     With fxCurrent
  245.         sldFeedback.Value = CLng(.fFeedback)
  246.         sldDelay.Value = CLng(.fDelay)
  247.         sldDepth.Value = CLng(.fDepth)
  248.         sldWetDry.Value = CLng(.fWetDryMix)
  249.         sldFreq.Value = CLng(.fFrequency)
  250.         sldPhase.Value = .lPhase
  251.         If .lWaveform = DSFX_WAVE_SIN Then
  252.             optSin.Value = True
  253.         ElseIf .lWaveform = DSFX_WAVE_TRIANGLE Then
  254.             optTriangle.Value = True
  255.         End If
  256.     End With
  257. End Sub
  258.  
  259. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  260.     'Store the buffer and index
  261.     Set oBuffer = oBuf
  262.     mlIndex = Index
  263. End Sub
  264.  
  265. Private Sub optSin_Click()
  266.     SaveAllSettings
  267. End Sub
  268.  
  269. Private Sub optTriangle_Click()
  270.     SaveAllSettings
  271. End Sub
  272.  
  273. Private Sub sldDelay_Change()
  274.     SaveAllSettings
  275. End Sub
  276.  
  277. Private Sub sldDelay_Scroll()
  278.     SaveAllSettings
  279. End Sub
  280.  
  281. Private Sub sldDepth_Change()
  282.     SaveAllSettings
  283. End Sub
  284.  
  285. Private Sub sldDepth_Scroll()
  286.     SaveAllSettings
  287. End Sub
  288.  
  289. Private Sub sldFeedback_Change()
  290.     SaveAllSettings
  291. End Sub
  292.  
  293. Private Sub sldFeedback_Scroll()
  294.     SaveAllSettings
  295. End Sub
  296.  
  297. Private Sub sldFreq_Change()
  298.     SaveAllSettings
  299. End Sub
  300.  
  301. Private Sub sldFreq_Scroll()
  302.     SaveAllSettings
  303. End Sub
  304.  
  305. Private Sub sldPhase_Change()
  306.     SaveAllSettings
  307. End Sub
  308.  
  309. Private Sub sldPhase_Scroll()
  310.     SaveAllSettings
  311. End Sub
  312.  
  313. Private Sub sldWetDry_Change()
  314.     SaveAllSettings
  315. End Sub
  316.  
  317. Private Sub sldWetDry_Scroll()
  318.     SaveAllSettings
  319. End Sub
  320.